

package com.hazelcast.internal.eviction;

import com.hazelcast.config.MaxSizePolicy;

/**
 * Checks whether a specific max size threshold is exceeded or not
 * according to configured {@link MaxSizePolicy}
 * and indicates whether eviction is required.
 */
public interface EvictionChecker {

    EvictionChecker EVICT_ALWAYS = () -> true;

    /**
     * Checks the state to see if it has reached its maximum configured size
     * {@link MaxSizePolicy}
     *
     * @return <code>true</code> if maximum size has been reached, <code>false</code> otherwise
     */
    boolean isEvictionRequired();

}
